package com.wing.product.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wing.common.annotation.RequestObjectFieldIgnore;
import com.wing.common.utils.JsonResult;
import com.wing.common.utils.PageResult;
import com.wing.product.model.entity.WarehouseOrder;
import com.wing.product.model.entity.WarehouseOrderDetail;
import com.wing.product.model.response.WarehouseOrderDetailVO;
import com.wing.product.model.response.WarehouseOrderVO;
import com.wing.product.service.WarehouseOrderDetailService;
import com.wing.product.service.WarehouseOrderDetailServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.Map;

/**
* 入库订单详情(warehouse_order_detail)表控制层
*
* @author xxxxx
*/
@Api(value = "托管入库管理", tags = "#/warehouse/product/orderDetail")
@RestController("WarehouseOrderDetailController")
@RequestMapping("/warehouse/orderDetail")
@RequiredArgsConstructor
public class WarehouseOrderDetailController {
/**
* 服务对象
*/
    @Autowired
    private WarehouseOrderDetailService warehouseOrderDetailService;



    @ApiOperation(value = "查询所有客户端", notes = "搜索")
    @GetMapping("/list")
    public PageResult<Page<WarehouseOrderDetailVO>> list(
            @RequestParam(value = "page", defaultValue = "1", required = false) Integer page
            ,@RequestParam(value = "limit", defaultValue = "10", required = false) Integer limit
            ,@RequestParam(value = "sort", defaultValue = "create_time", required = false) String sort
            ,@RequestParam(value = "order", defaultValue = "asc", required = false) String order
            ,Long orderId
    ){

        Page<WarehouseOrderDetail> pg = new Page<>(page, limit);
        Map paramMap=new HashMap();
        paramMap.put("orderId",orderId);
        //搜索
        return warehouseOrderDetailService.pageList4app(pg,paramMap);
    }
}
